3.7.90 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx\) [690]

3.7.90.1 Optimal result
3.7.90.2 Mathematica [A] (verified)
3.7.90.3 Rubi [A] (verified)
3.7.90.4 Maple [A] (verified)
3.7.90.5 Fricas [A] (verification not implemented)
3.7.90.6 Sympy [B] (verification not implemented)
3.7.90.7 Maxima [A] (verification not implemented)
3.7.90.8 Giac [B] (verification not implemented)
3.7.90.9 Mupad [B] (verification not implemented)

3.7.90.1 Optimal result

Integrand size = 41, antiderivative size = 135 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=\frac {2 a^3 (i A+B) c^6 (1-i \tan (e+f x))^6}{3 f}-\frac {4 a^3 (i A+2 B) c^6 (1-i \tan (e+f x))^7}{7 f}+\frac {a^3 (i A+5 B) c^6 (1-i \tan (e+f x))^8}{8 f}-\frac {a^3 B c^6 (1-i \tan (e+f x))^9}{9 f} \]

output
2/3*a^3*(I*A+B)*c^6*(1-I*tan(f*x+e))^6/f-4/7*a^3*(I*A+2*B)*c^6*(1-I*tan(f* 
x+e))^7/f+1/8*a^3*(I*A+5*B)*c^6*(1-I*tan(f*x+e))^8/f-1/9*a^3*B*c^6*(1-I*ta 
n(f*x+e))^9/f
 
3.7.90.2 Mathematica [A] (verified)

Time = 5.89 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.11 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=\frac {a^3 c^6 \sec ^9(e+f x) (126 (-3 i A+B) \cos (e+f x)+168 (-i A+B) \cos (3 (e+f x))+84 A \sin (3 (e+f x))-84 i B \sin (3 (e+f x))+108 A \sin (5 (e+f x))+36 i B \sin (5 (e+f x))+27 A \sin (7 (e+f x))+9 i B \sin (7 (e+f x))+3 A \sin (9 (e+f x))+i B \sin (9 (e+f x)))}{1008 f} \]

input
Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f 
*x])^6,x]
 
output
(a^3*c^6*Sec[e + f*x]^9*(126*((-3*I)*A + B)*Cos[e + f*x] + 168*((-I)*A + B 
)*Cos[3*(e + f*x)] + 84*A*Sin[3*(e + f*x)] - (84*I)*B*Sin[3*(e + f*x)] + 1 
08*A*Sin[5*(e + f*x)] + (36*I)*B*Sin[5*(e + f*x)] + 27*A*Sin[7*(e + f*x)] 
+ (9*I)*B*Sin[7*(e + f*x)] + 3*A*Sin[9*(e + f*x)] + I*B*Sin[9*(e + f*x)])) 
/(1008*f)
 
3.7.90.3 Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.81, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 86, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^6 (A+B \tan (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^6 (A+B \tan (e+f x))dx\)

\(\Big \downarrow \) 4071

\(\displaystyle \frac {a c \int a^2 c^5 (1-i \tan (e+f x))^5 (i \tan (e+f x)+1)^2 (A+B \tan (e+f x))d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {a^3 c^6 \int (1-i \tan (e+f x))^5 (i \tan (e+f x)+1)^2 (A+B \tan (e+f x))d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 86

\(\displaystyle \frac {a^3 c^6 \int \left (i B (1-i \tan (e+f x))^8+(A-5 i B) (1-i \tan (e+f x))^7-4 (A-2 i B) (1-i \tan (e+f x))^6+4 (A-i B) (1-i \tan (e+f x))^5\right )d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 c^6 \left (\frac {1}{8} (5 B+i A) (1-i \tan (e+f x))^8-\frac {4}{7} (2 B+i A) (1-i \tan (e+f x))^7+\frac {2}{3} (B+i A) (1-i \tan (e+f x))^6-\frac {1}{9} B (1-i \tan (e+f x))^9\right )}{f}\)

input
Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^6 
,x]
 
output
(a^3*c^6*((2*(I*A + B)*(1 - I*Tan[e + f*x])^6)/3 - (4*(I*A + 2*B)*(1 - I*T 
an[e + f*x])^7)/7 + ((I*A + 5*B)*(1 - I*Tan[e + f*x])^8)/8 - (B*(1 - I*Tan 
[e + f*x])^9)/9))/f
 

3.7.90.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4071
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si 
mp[a*(c/f)   Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x 
, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c 
+ a*d, 0] && EqQ[a^2 + b^2, 0]
 
3.7.90.4 Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.80

method result size
risch \(\frac {32 c^{6} a^{3} \left (84 i A \,{\mathrm e}^{6 i \left (f x +e \right )}+84 B \,{\mathrm e}^{6 i \left (f x +e \right )}+108 i A \,{\mathrm e}^{4 i \left (f x +e \right )}-36 B \,{\mathrm e}^{4 i \left (f x +e \right )}+27 i A \,{\mathrm e}^{2 i \left (f x +e \right )}-9 B \,{\mathrm e}^{2 i \left (f x +e \right )}+3 i A -B \right )}{63 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{9}}\) \(108\)
derivativedivides \(\frac {i c^{6} a^{3} \left (\frac {B \tan \left (f x +e \right )^{9}}{9}+\frac {\left (3 i B +A \right ) \tan \left (f x +e \right )^{8}}{8}+\frac {\left (-11 B -2 i A +5 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{7}}{7}+\frac {\left (-11 A +5 i \left (-2 i A -B \right )+10 i B \right ) \tan \left (f x +e \right )^{6}}{6}+\frac {\left (15 i A +15 B -10 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{5}}{5}+\frac {\left (15 A -10 i \left (-2 i A -B \right )-9 i B \right ) \tan \left (f x +e \right )^{4}}{4}+\frac {\left (-5 B +i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{3}}{3}+\frac {\left (-5 A +i \left (-2 i A -B \right )\right ) \tan \left (f x +e \right )^{2}}{2}-i \tan \left (f x +e \right ) A \right )}{f}\) \(211\)
default \(\frac {i c^{6} a^{3} \left (\frac {B \tan \left (f x +e \right )^{9}}{9}+\frac {\left (3 i B +A \right ) \tan \left (f x +e \right )^{8}}{8}+\frac {\left (-11 B -2 i A +5 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{7}}{7}+\frac {\left (-11 A +5 i \left (-2 i A -B \right )+10 i B \right ) \tan \left (f x +e \right )^{6}}{6}+\frac {\left (15 i A +15 B -10 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{5}}{5}+\frac {\left (15 A -10 i \left (-2 i A -B \right )-9 i B \right ) \tan \left (f x +e \right )^{4}}{4}+\frac {\left (-5 B +i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{3}}{3}+\frac {\left (-5 A +i \left (-2 i A -B \right )\right ) \tan \left (f x +e \right )^{2}}{2}-i \tan \left (f x +e \right ) A \right )}{f}\) \(211\)
norman \(\frac {A \,a^{3} c^{6} \tan \left (f x +e \right )}{f}-\frac {\left (3 i B \,a^{3} c^{6}+A \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{3}}{3 f}-\frac {\left (5 i A \,a^{3} c^{6}+B \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{4}}{4 f}-\frac {\left (-i A \,a^{3} c^{6}+3 B \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{8}}{8 f}-\frac {\left (i B \,a^{3} c^{6}+A \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{5}}{f}-\frac {\left (i B \,a^{3} c^{6}+3 A \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{7}}{7 f}-\frac {\left (i A \,a^{3} c^{6}+5 B \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{6}}{6 f}+\frac {\left (-3 i A \,a^{3} c^{6}+B \,a^{3} c^{6}\right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {i B \,a^{3} c^{6} \tan \left (f x +e \right )^{9}}{9 f}\) \(267\)
parallelrisch \(\frac {-504 i B \tan \left (f x +e \right )^{3} a^{3} c^{6}-72 i B \tan \left (f x +e \right )^{7} a^{3} c^{6}-84 i A \tan \left (f x +e \right )^{6} a^{3} c^{6}-189 B \tan \left (f x +e \right )^{8} a^{3} c^{6}-504 i B \tan \left (f x +e \right )^{5} a^{3} c^{6}-216 A \tan \left (f x +e \right )^{7} a^{3} c^{6}-630 i A \tan \left (f x +e \right )^{4} a^{3} c^{6}-420 B \tan \left (f x +e \right )^{6} a^{3} c^{6}+56 i B \,a^{3} c^{6} \tan \left (f x +e \right )^{9}-504 A \tan \left (f x +e \right )^{5} a^{3} c^{6}-756 i A \tan \left (f x +e \right )^{2} a^{3} c^{6}-126 B \tan \left (f x +e \right )^{4} a^{3} c^{6}+63 i A \tan \left (f x +e \right )^{8} a^{3} c^{6}-168 A \tan \left (f x +e \right )^{3} a^{3} c^{6}+252 B \tan \left (f x +e \right )^{2} a^{3} c^{6}+504 A \tan \left (f x +e \right ) a^{3} c^{6}}{504 f}\) \(285\)
parts \(\frac {\left (-8 i B \,a^{3} c^{6}-6 A \,a^{3} c^{6}\right ) \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (-6 i A \,a^{3} c^{6}-6 B \,a^{3} c^{6}\right ) \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (-6 i B \,a^{3} c^{6}-8 A \,a^{3} c^{6}\right ) \left (\frac {\tan \left (f x +e \right )^{5}}{5}-\frac {\tan \left (f x +e \right )^{3}}{3}+\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (-3 i A \,a^{3} c^{6}+B \,a^{3} c^{6}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {\left (i A \,a^{3} c^{6}-3 B \,a^{3} c^{6}\right ) \left (\frac {\tan \left (f x +e \right )^{8}}{8}-\frac {\tan \left (f x +e \right )^{6}}{6}+\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+A \,a^{3} c^{6} x -\frac {8 i A \,a^{3} c^{6} \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}-\frac {3 i B \,a^{3} c^{6} \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {i B \,a^{3} c^{6} \left (\frac {\tan \left (f x +e \right )^{9}}{9}-\frac {\tan \left (f x +e \right )^{7}}{7}+\frac {\tan \left (f x +e \right )^{5}}{5}-\frac {\tan \left (f x +e \right )^{3}}{3}+\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}-\frac {3 A \,a^{3} c^{6} \left (\frac {\tan \left (f x +e \right )^{7}}{7}-\frac {\tan \left (f x +e \right )^{5}}{5}+\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}-\frac {8 B \,a^{3} c^{6} \left (\frac {\tan \left (f x +e \right )^{6}}{6}-\frac {\tan \left (f x +e \right )^{4}}{4}+\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}\) \(541\)

input
int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^6,x,method=_R 
ETURNVERBOSE)
 
output
32/63*c^6*a^3*(84*I*A*exp(6*I*(f*x+e))+84*B*exp(6*I*(f*x+e))+108*I*A*exp(4 
*I*(f*x+e))-36*B*exp(4*I*(f*x+e))+27*I*A*exp(2*I*(f*x+e))-9*B*exp(2*I*(f*x 
+e))+3*I*A-B)/f/(exp(2*I*(f*x+e))+1)^9
 
3.7.90.5 Fricas [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.44 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=-\frac {32 \, {\left (84 \, {\left (-i \, A - B\right )} a^{3} c^{6} e^{\left (6 i \, f x + 6 i \, e\right )} + 36 \, {\left (-3 i \, A + B\right )} a^{3} c^{6} e^{\left (4 i \, f x + 4 i \, e\right )} + 9 \, {\left (-3 i \, A + B\right )} a^{3} c^{6} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-3 i \, A + B\right )} a^{3} c^{6}\right )}}{63 \, {\left (f e^{\left (18 i \, f x + 18 i \, e\right )} + 9 \, f e^{\left (16 i \, f x + 16 i \, e\right )} + 36 \, f e^{\left (14 i \, f x + 14 i \, e\right )} + 84 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 126 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 126 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 84 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 36 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 9 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^6,x, al 
gorithm="fricas")
 
output
-32/63*(84*(-I*A - B)*a^3*c^6*e^(6*I*f*x + 6*I*e) + 36*(-3*I*A + B)*a^3*c^ 
6*e^(4*I*f*x + 4*I*e) + 9*(-3*I*A + B)*a^3*c^6*e^(2*I*f*x + 2*I*e) + (-3*I 
*A + B)*a^3*c^6)/(f*e^(18*I*f*x + 18*I*e) + 9*f*e^(16*I*f*x + 16*I*e) + 36 
*f*e^(14*I*f*x + 14*I*e) + 84*f*e^(12*I*f*x + 12*I*e) + 126*f*e^(10*I*f*x 
+ 10*I*e) + 126*f*e^(8*I*f*x + 8*I*e) + 84*f*e^(6*I*f*x + 6*I*e) + 36*f*e^ 
(4*I*f*x + 4*I*e) + 9*f*e^(2*I*f*x + 2*I*e) + f)
 
3.7.90.6 Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 325 vs. \(2 (110) = 220\).

Time = 0.93 (sec) , antiderivative size = 325, normalized size of antiderivative = 2.41 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=\frac {96 i A a^{3} c^{6} - 32 B a^{3} c^{6} + \left (864 i A a^{3} c^{6} e^{2 i e} - 288 B a^{3} c^{6} e^{2 i e}\right ) e^{2 i f x} + \left (3456 i A a^{3} c^{6} e^{4 i e} - 1152 B a^{3} c^{6} e^{4 i e}\right ) e^{4 i f x} + \left (2688 i A a^{3} c^{6} e^{6 i e} + 2688 B a^{3} c^{6} e^{6 i e}\right ) e^{6 i f x}}{63 f e^{18 i e} e^{18 i f x} + 567 f e^{16 i e} e^{16 i f x} + 2268 f e^{14 i e} e^{14 i f x} + 5292 f e^{12 i e} e^{12 i f x} + 7938 f e^{10 i e} e^{10 i f x} + 7938 f e^{8 i e} e^{8 i f x} + 5292 f e^{6 i e} e^{6 i f x} + 2268 f e^{4 i e} e^{4 i f x} + 567 f e^{2 i e} e^{2 i f x} + 63 f} \]

input
integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**6,x)
 
output
(96*I*A*a**3*c**6 - 32*B*a**3*c**6 + (864*I*A*a**3*c**6*exp(2*I*e) - 288*B 
*a**3*c**6*exp(2*I*e))*exp(2*I*f*x) + (3456*I*A*a**3*c**6*exp(4*I*e) - 115 
2*B*a**3*c**6*exp(4*I*e))*exp(4*I*f*x) + (2688*I*A*a**3*c**6*exp(6*I*e) + 
2688*B*a**3*c**6*exp(6*I*e))*exp(6*I*f*x))/(63*f*exp(18*I*e)*exp(18*I*f*x) 
 + 567*f*exp(16*I*e)*exp(16*I*f*x) + 2268*f*exp(14*I*e)*exp(14*I*f*x) + 52 
92*f*exp(12*I*e)*exp(12*I*f*x) + 7938*f*exp(10*I*e)*exp(10*I*f*x) + 7938*f 
*exp(8*I*e)*exp(8*I*f*x) + 5292*f*exp(6*I*e)*exp(6*I*f*x) + 2268*f*exp(4*I 
*e)*exp(4*I*f*x) + 567*f*exp(2*I*e)*exp(2*I*f*x) + 63*f)
 
3.7.90.7 Maxima [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 193, normalized size of antiderivative = 1.43 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=-\frac {-56 i \, B a^{3} c^{6} \tan \left (f x + e\right )^{9} + 63 \, {\left (-i \, A + 3 \, B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{8} + 72 \, {\left (3 \, A + i \, B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{7} + 84 \, {\left (i \, A + 5 \, B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{6} + 504 \, {\left (A + i \, B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{5} + 126 \, {\left (5 i \, A + B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{4} + 168 \, {\left (A + 3 i \, B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{3} + 252 \, {\left (3 i \, A - B\right )} a^{3} c^{6} \tan \left (f x + e\right )^{2} - 504 \, A a^{3} c^{6} \tan \left (f x + e\right )}{504 \, f} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^6,x, al 
gorithm="maxima")
 
output
-1/504*(-56*I*B*a^3*c^6*tan(f*x + e)^9 + 63*(-I*A + 3*B)*a^3*c^6*tan(f*x + 
 e)^8 + 72*(3*A + I*B)*a^3*c^6*tan(f*x + e)^7 + 84*(I*A + 5*B)*a^3*c^6*tan 
(f*x + e)^6 + 504*(A + I*B)*a^3*c^6*tan(f*x + e)^5 + 126*(5*I*A + B)*a^3*c 
^6*tan(f*x + e)^4 + 168*(A + 3*I*B)*a^3*c^6*tan(f*x + e)^3 + 252*(3*I*A - 
B)*a^3*c^6*tan(f*x + e)^2 - 504*A*a^3*c^6*tan(f*x + e))/f
 
3.7.90.8 Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 239 vs. \(2 (113) = 226\).

Time = 1.29 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.77 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=-\frac {32 \, {\left (-84 i \, A a^{3} c^{6} e^{\left (6 i \, f x + 6 i \, e\right )} - 84 \, B a^{3} c^{6} e^{\left (6 i \, f x + 6 i \, e\right )} - 108 i \, A a^{3} c^{6} e^{\left (4 i \, f x + 4 i \, e\right )} + 36 \, B a^{3} c^{6} e^{\left (4 i \, f x + 4 i \, e\right )} - 27 i \, A a^{3} c^{6} e^{\left (2 i \, f x + 2 i \, e\right )} + 9 \, B a^{3} c^{6} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 i \, A a^{3} c^{6} + B a^{3} c^{6}\right )}}{63 \, {\left (f e^{\left (18 i \, f x + 18 i \, e\right )} + 9 \, f e^{\left (16 i \, f x + 16 i \, e\right )} + 36 \, f e^{\left (14 i \, f x + 14 i \, e\right )} + 84 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 126 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 126 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 84 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 36 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 9 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^6,x, al 
gorithm="giac")
 
output
-32/63*(-84*I*A*a^3*c^6*e^(6*I*f*x + 6*I*e) - 84*B*a^3*c^6*e^(6*I*f*x + 6* 
I*e) - 108*I*A*a^3*c^6*e^(4*I*f*x + 4*I*e) + 36*B*a^3*c^6*e^(4*I*f*x + 4*I 
*e) - 27*I*A*a^3*c^6*e^(2*I*f*x + 2*I*e) + 9*B*a^3*c^6*e^(2*I*f*x + 2*I*e) 
 - 3*I*A*a^3*c^6 + B*a^3*c^6)/(f*e^(18*I*f*x + 18*I*e) + 9*f*e^(16*I*f*x + 
 16*I*e) + 36*f*e^(14*I*f*x + 14*I*e) + 84*f*e^(12*I*f*x + 12*I*e) + 126*f 
*e^(10*I*f*x + 10*I*e) + 126*f*e^(8*I*f*x + 8*I*e) + 84*f*e^(6*I*f*x + 6*I 
*e) + 36*f*e^(4*I*f*x + 4*I*e) + 9*f*e^(2*I*f*x + 2*I*e) + f)
 
3.7.90.9 Mupad [B] (verification not implemented)

Time = 8.72 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.54 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^6 \, dx=\frac {A\,a^3\,c^6\,\mathrm {tan}\left (e+f\,x\right )+\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-3\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}+a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (-B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (5\,A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4}+\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^7\,\left (-B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{7}-\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (3\,A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}-\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (A-B\,5{}\mathrm {i}\right )\,1{}\mathrm {i}}{6}+\frac {a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^8\,\left (A+B\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{8}+\frac {B\,a^3\,c^6\,{\mathrm {tan}\left (e+f\,x\right )}^9\,1{}\mathrm {i}}{9}}{f} \]

input
int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i) 
^6,x)
 
output
((a^3*c^6*tan(e + f*x)^3*(A*1i - 3*B)*1i)/3 - (a^3*c^6*tan(e + f*x)^2*(3*A 
 + B*1i)*1i)/2 + a^3*c^6*tan(e + f*x)^5*(A*1i - B)*1i - (a^3*c^6*tan(e + f 
*x)^4*(5*A - B*1i)*1i)/4 + (a^3*c^6*tan(e + f*x)^7*(A*3i - B)*1i)/7 + A*a^ 
3*c^6*tan(e + f*x) - (a^3*c^6*tan(e + f*x)^6*(A - B*5i)*1i)/6 + (a^3*c^6*t 
an(e + f*x)^8*(A + B*3i)*1i)/8 + (B*a^3*c^6*tan(e + f*x)^9*1i)/9)/f